<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 多维数组：数组嵌套数组
        const arr = [1, 2, [3, 4]] // 二维数组
        console.log(arr[0])
        console.log(arr[1])
        console.log(arr[2]) // [3, 4]
        // 取内层数组的元素
        console.log(arr[2][0])
        console.log(arr[2][1])

        // 多维数组的解构
        // const [a, b, c] = arr
        // console.log(a, b, c)
        // 数组的解构是一种模式匹配，左侧和右侧的模式一样
        const [a, b, [c, d]] = arr
        console.log(a, b, c, d)
    </script>
</body>

</html>